<?php

namespace App\Extensions\Grid\Displayers;

class Copyable extends \Encore\Admin\Grid\Displayers\Copyable
{
    public function display()
    {
        $this->addScript();

        $content = $this->getColumn()->getOriginal();
        if (!$content) {
            return $this->getValue();
        }

        return <<<HTML
<a href="javascript:void(0);" class="grid-column-copyable text-muted" data-content="{$content}" title="Copied!" data-placement="bottom">
    <i class="fa fa-copy"></i>
</a>&nbsp;{$this->getValue()}
HTML;
    }

}
